home *** CD-ROM | disk | FTP | other *** search
-
- package sub_arctic.constraints;
-
- /**
- * An interface for objects that provide values within the "external value"
- * system. This system bridges the lightweight constraint system to
- * external entities -- either to non-local dependents, to heavyweight
- * constraints, or to "application" objects. Value_provider objects can
- * maintain several values (parts) which are selected via a unique integer
- * designator. Value_providers are responsible for notifying a set of
- * value_consumer objects that have registered interest whenever one of
- * these values changes.
- *
- * @author Scott Hudson
- */
- public interface value_provider {
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Get an up-to-date copy of (or reference to) a particular value. All
- * values must be Objects. If you need to pass a builtin type (e.g., int),
- * use the corresponding Object form (e.g., Integer).<p>
- *
- * @param int part_number the part number whose value is being requested.
- * @return Object an object holding the up-to-date value of that part.
- */
- public Object get_value(int part_number);
- // later we should probably provide separate methods for primitive types
- // these can by default throw a bad type exception
-
- //had:
- //* @exception bad_value if an invalid part number is given.
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Register something as interested in (dependent on) one of the parts of
- * this object. The entity registered is a part within a value_consumer
- * object. Whenever a value represented by this part of this value_provider
- * changes (or might change), the value_ood() method must be invoked on each
- * currently registered (object,part). <p>
- *
- * @param int on_part_num number of our part.
- * @param value_consumer dep_obj the object that uses that part.
- * @param int dep_part the part within that object that uses
- * our part.
- */
- public void attach_dependent(
- int on_part_num,
- value_consumer dep_obj,
- int dep_part);
-
- //had:
- //* @exception bad_value if an invalid part number is given.
- //* @exception general
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Remove an (object,part) pair from the dependent (interested in) list. <p>
- *
- * @param int on_part_num number of our part.
- * @param value_consumer dep_obj the object that formerly used that part.
- * @param int dep_part the part within that object that
- * formerly used our part.
- */
- public void detach_dependent(
- int on_part_num,
- value_consumer dep_obj,
- int dep_part);
-
- //had:
- //* @exception bad_value if an invalid part number is given.
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-